



<?php
/**
 * Created by PhpStorm.
 * User: Administrator
 * Date: 2021/12/6
 * Time: 10:25
 */
if(empty($_POST['user'])){
    echo '手机/邮箱/个人空间地址不能为空！！！';
    die;
}
if(empty($_POST['pwd'])){
    echo '密码不能为空！！！';
    die;
}
$user= $_POST['user'];
$pwd=$_POST['pwd'];
if($user=='admin'&&$pwd=='888888'){
    echo '<br />';
    echo '<h1>用户中心</h1>';
    $md= md5($user.$pwd.time());
    setcookie('Token',$md,time()+24*3600);
    if(!empty($_COOKIE['Token'])){
        echo 'cookie存在！！！<br />';
        echo '你的cookies名字为'.$_COOKIE['Token'];
        echo '<br />';
        ?>
        <!DOCTYPE html>
        <html>
        <head>
            <meta charset="utf-8">
            <title></title>
            <style type="text/css">
                #div_tou{
                    display: flex;
                    width: 50px;
                    height: 50px;
                    background-color: aliceblue;
                }
            </style>
        </head>
        <body>
        <div id="div_tou">
            <form action="zuo3.php" method="post" enctype="multipart/form-data">
                <input type="file" src="" name="file"  id="file" multiple="multiple" /><br />
                <img src="" id="imgurl" alt="请选择头像">
                <br />
                <button type="button" onclick="tou()">显示头像</button>
                <button type="submit">提交</button>
            </form>
        </div>
        </body>
        <script type="text/javascript">
            function tou(){
                var file_id=document.getElementById('file');
                var files=file_id['files'];
                var URL=window.URL||window.webkitURL;
                var imgURL=URL.createObjectURL(files[0]);
                document.getElementById('imgurl').src=imgURL;
            }
        </script>
        </html><?




    }
}else{
    echo '手机/邮箱/个人空间地址或密码错误！！！';
}


